<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class RSS::Maker::Base - rss: Ruby Standard Library Documentation</title>


<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<script src="../../js/jquery-3.2.0.min.js"></script>

<script src="../../js/vue.min.js"></script>
<script src="../../js/js.cookie.min.js"></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../css/rdoc.css" rel="stylesheet">
<link href="../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
  var darkModeCsseHref = "../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><span class="include">Enumerable</span>
  </ul>
</div>

        
<div id="extends-section" class="nav-section">
  <h3>Extended With Modules</h3>

  <ul class="link-list">
    <li><a class="extend" href="../Utils/InheritedReader.html">RSS::Utils::InheritedReader</a>
    <li><span class="extend">Forwardable</span>
  </ul>
</div>

        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-add_need_initialize_variable">::add_need_initialize_variable</a>
    <li ><a href="#method-c-add_other_element">::add_other_element</a>
    <li ><a href="#method-c-def_array_element">::def_array_element</a>
    <li ><a href="#method-c-def_classed_element">::def_classed_element</a>
    <li ><a href="#method-c-def_classed_element_without_accessor">::def_classed_element_without_accessor</a>
    <li ><a href="#method-c-def_classed_elements">::def_classed_elements</a>
    <li ><a href="#method-c-def_csv_element">::def_csv_element</a>
    <li ><a href="#method-c-def_other_element">::def_other_element</a>
    <li ><a href="#method-c-def_other_element_without_accessor">::def_other_element_without_accessor</a>
    <li ><a href="#method-c-inherited">::inherited</a>
    <li ><a href="#method-c-inherited_base">::inherited_base</a>
    <li ><a href="#method-c-need_initialize_variables">::need_initialize_variables</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-c-other_elements">::other_elements</a>
    <li ><a href="#method-i-_set_default_values">#_set_default_values</a>
    <li ><a href="#method-i-current_element">#current_element</a>
    <li ><a href="#method-i-have_required_values-3F">#have_required_values?</a>
    <li ><a href="#method-i-initialize_variables">#initialize_variables</a>
    <li ><a href="#method-i-not_set_required_variables">#not_set_required_variables</a>
    <li ><a href="#method-i-required_variables_are_set-3F">#required_variables_are_set?</a>
    <li ><a href="#method-i-set_default_values">#set_default_values</a>
    <li ><a href="#method-i-set_parent">#set_parent</a>
    <li ><a href="#method-i-setup_other_elements">#setup_other_elements</a>
    <li ><a href="#method-i-setup_values">#setup_values</a>
    <li ><a href="#method-i-variable_is_set-3F">#variable_is_set?</a>
    <li ><a href="#method-i-variables">#variables</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-RSS::Maker::Base">
    <h1 id="class-RSS::Maker::Base" class="class">
      class RSS::Maker::Base
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="NEED_INITIALIZE_VARIABLES">NEED_INITIALIZE_VARIABLES
          <dd>
          <dt id="OTHER_ELEMENTS">OTHER_ELEMENTS
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-maker" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">maker</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-add_need_initialize_variable" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_need_initialize_variable</span><span
                                class="method-args">(variable_name, init_value=nil, &amp;init_block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_need_initialize_variable-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 35</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_need_initialize_variable</span>(<span class="ruby-identifier">variable_name</span>, <span class="ruby-identifier">init_value</span>=<span class="ruby-keyword">nil</span>,
                                 <span class="ruby-operator">&amp;</span><span class="ruby-identifier">init_block</span>)
  <span class="ruby-identifier">init_value</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">init_block</span>
  <span class="ruby-keyword">self</span><span class="ruby-operator">::</span><span class="ruby-constant">NEED_INITIALIZE_VARIABLES</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">variable_name</span>, <span class="ruby-identifier">init_value</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-add_other_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_other_element</span><span
                                class="method-args">(variable_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_other_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 31</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_other_element</span>(<span class="ruby-identifier">variable_name</span>)
  <span class="ruby-keyword">self</span><span class="ruby-operator">::</span><span class="ruby-constant">OTHER_ELEMENTS</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">variable_name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-def_array_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">def_array_element</span><span
                                class="method-args">(name, plural=nil, klass_name=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="def_array_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 41</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">def_array_element</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">plural</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">klass_name</span>=<span class="ruby-keyword">nil</span>)
          <span class="ruby-identifier">include</span> <span class="ruby-constant">Enumerable</span>
          <span class="ruby-identifier">extend</span> <span class="ruby-constant">Forwardable</span>

          <span class="ruby-identifier">plural</span> <span class="ruby-operator">||=</span> <span class="ruby-node">&quot;#{name}s&quot;</span>
          <span class="ruby-identifier">klass_name</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">to_class_name</span>(<span class="ruby-identifier">name</span>)
          <span class="ruby-identifier">def_delegators</span>(<span class="ruby-node">&quot;@#{plural}&quot;</span>, <span class="ruby-value">:&lt;&lt;</span>, <span class="ruby-value">:[]</span>, <span class="ruby-value">:[]=</span>, <span class="ruby-value">:first</span>, <span class="ruby-value">:last</span>)
          <span class="ruby-identifier">def_delegators</span>(<span class="ruby-node">&quot;@#{plural}&quot;</span>, <span class="ruby-value">:push</span>, <span class="ruby-value">:pop</span>, <span class="ruby-value">:shift</span>, <span class="ruby-value">:unshift</span>)
          <span class="ruby-identifier">def_delegators</span>(<span class="ruby-node">&quot;@#{plural}&quot;</span>, <span class="ruby-value">:each</span>, <span class="ruby-value">:size</span>, <span class="ruby-value">:empty?</span>, <span class="ruby-value">:clear</span>)

          <span class="ruby-identifier">add_need_initialize_variable</span>(<span class="ruby-identifier">plural</span>) {[]}

          <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
<span class="ruby-value">            def new_#{name}
              #{name} = self.class::#{klass_name}.new(@maker)
              @#{plural} &lt;&lt; #{name}
              if block_given?
                yield #{name}
              else
                #{name}
              end
            end
            alias new_child new_#{name}

            def to_feed(*args)
              @#{plural}.each do |#{name}|
                #{name}.to_feed(*args)
              end
            end

            def replace(elements)
              @#{plural}.replace(elements.to_a)
            end
</span><span class="ruby-identifier">          EOC</span>
        <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-def_classed_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">def_classed_element</span><span
                                class="method-args">(name, class_name=nil, attribute_name=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="def_classed_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 95</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">def_classed_element</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">class_name</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">attribute_name</span>=<span class="ruby-keyword">nil</span>)
          <span class="ruby-identifier">def_classed_element_without_accessor</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">class_name</span>)
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">attribute_name</span>
            <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
<span class="ruby-value">              def #{name}
                if block_given?
                  yield(@#{name})
                else
                  @#{name}.#{attribute_name}
                end
              end

              def #{name}=(new_value)
                @#{name}.#{attribute_name} = new_value
              end
</span><span class="ruby-identifier">            EOC</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">attr_reader</span> <span class="ruby-identifier">name</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-def_classed_element_without_accessor" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">def_classed_element_without_accessor</span><span
                                class="method-args">(name, class_name=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="def_classed_element_without_accessor-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 77</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">def_classed_element_without_accessor</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">class_name</span>=<span class="ruby-keyword">nil</span>)
          <span class="ruby-identifier">class_name</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">to_class_name</span>(<span class="ruby-identifier">name</span>)
          <span class="ruby-identifier">add_other_element</span>(<span class="ruby-identifier">name</span>)
          <span class="ruby-identifier">add_need_initialize_variable</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
            <span class="ruby-identifier">object</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;make_#{name}&quot;</span>)
          <span class="ruby-keyword">end</span>
          <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
<span class="ruby-value">            private
            def setup_#{name}(feed, current)
              @#{name}.to_feed(feed, current)
            end

            def make_#{name}
              self.class::#{class_name}.new(@maker)
            end
</span><span class="ruby-identifier">          EOC</span>
        <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-def_classed_elements" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">def_classed_elements</span><span
                                class="method-args">(name, attribute, plural_class_name=nil, plural_name=nil, new_name=nil) { |local_variable_name, new_value_variable_name| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="def_classed_elements-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 116</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">def_classed_elements</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">attribute</span>, <span class="ruby-identifier">plural_class_name</span>=<span class="ruby-keyword">nil</span>,
                                 <span class="ruby-identifier">plural_name</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">new_name</span>=<span class="ruby-keyword">nil</span>)
          <span class="ruby-identifier">plural_name</span> <span class="ruby-operator">||=</span> <span class="ruby-node">&quot;#{name}s&quot;</span>
          <span class="ruby-identifier">new_name</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">name</span>
          <span class="ruby-identifier">def_classed_element</span>(<span class="ruby-identifier">plural_name</span>, <span class="ruby-identifier">plural_class_name</span>)
          <span class="ruby-identifier">local_variable_name</span> = <span class="ruby-node">&quot;_#{name}&quot;</span>
          <span class="ruby-identifier">new_value_variable_name</span> = <span class="ruby-string">&quot;new_value&quot;</span>
          <span class="ruby-identifier">additional_setup_code</span> = <span class="ruby-keyword">nil</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
            <span class="ruby-identifier">additional_setup_code</span> = <span class="ruby-keyword">yield</span>(<span class="ruby-identifier">local_variable_name</span>,
                                          <span class="ruby-identifier">new_value_variable_name</span>)
          <span class="ruby-keyword">end</span>
          <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
<span class="ruby-value">            def #{name}
              #{local_variable_name} = #{plural_name}.first
              #{local_variable_name} ? #{local_variable_name}.#{attribute} : nil
            end

            def #{name}=(#{new_value_variable_name})
              #{local_variable_name} =
                #{plural_name}.first || #{plural_name}.new_#{new_name}
              #{additional_setup_code}
              #{local_variable_name}.#{attribute} = #{new_value_variable_name}
            end
</span><span class="ruby-identifier">          EOC</span>
        <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-def_csv_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">def_csv_element</span><span
                                class="method-args">(name, type=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="def_csv_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 160</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">def_csv_element</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">type</span>=<span class="ruby-keyword">nil</span>)
          <span class="ruby-identifier">def_other_element_without_accessor</span>(<span class="ruby-identifier">name</span>)
          <span class="ruby-identifier">attr_reader</span>(<span class="ruby-identifier">name</span>)
          <span class="ruby-identifier">converter</span> = <span class="ruby-string">&quot;&quot;</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:integer</span>
            <span class="ruby-identifier">converter</span> = <span class="ruby-string">&quot;{|v| Integer(v)}&quot;</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
<span class="ruby-value">            def #{name}=(value)
              @#{name} = Utils::CSV.parse(value)#{converter}
            end
</span><span class="ruby-identifier">          EOC</span>
        <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-def_other_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">def_other_element</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="def_other_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 143</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">def_other_element</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">attr_accessor</span> <span class="ruby-identifier">name</span>
  <span class="ruby-identifier">def_other_element_without_accessor</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-def_other_element_without_accessor" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">def_other_element_without_accessor</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="def_other_element_without_accessor-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 148</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">def_other_element_without_accessor</span>(<span class="ruby-identifier">name</span>)
          <span class="ruby-identifier">add_need_initialize_variable</span>(<span class="ruby-identifier">name</span>)
          <span class="ruby-identifier">add_other_element</span>(<span class="ruby-identifier">name</span>)
          <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
<span class="ruby-value">            def setup_#{name}(feed, current)
              if !@#{name}.nil? and current.respond_to?(:#{name}=)
                current.#{name} = @#{name}
              end
            end
</span><span class="ruby-identifier">          EOC</span>
        <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-inherited" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inherited</span><span
                                class="method-args">(subclass)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="inherited-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inherited</span>(<span class="ruby-identifier">subclass</span>)
  <span class="ruby-identifier">subclass</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-value">:OTHER_ELEMENTS</span>, [])
  <span class="ruby-identifier">subclass</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-value">:NEED_INITIALIZE_VARIABLES</span>, [])
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-inherited_base" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inherited_base</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="inherited_base-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 22</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inherited_base</span>
  <span class="ruby-operator">::</span><span class="ruby-constant">RSS</span><span class="ruby-operator">::</span><span class="ruby-constant">Maker</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-need_initialize_variables" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">need_initialize_variables</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="need_initialize_variables-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 18</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">need_initialize_variables</span>
  <span class="ruby-identifier">inherited_array_reader</span>(<span class="ruby-string">&quot;NEED_INITIALIZE_VARIABLES&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(maker)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 176</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">maker</span>)
  <span class="ruby-ivar">@maker</span> = <span class="ruby-identifier">maker</span>
  <span class="ruby-ivar">@default_values_are_set</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-identifier">initialize_variables</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-other_elements" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">other_elements</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="other_elements-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 15</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">other_elements</span>
  <span class="ruby-identifier">inherited_array_reader</span>(<span class="ruby-string">&quot;OTHER_ELEMENTS&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-have_required_values-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">have_required_values?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="have_required_values-3F-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 182</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">have_required_values?</span>
  <span class="ruby-identifier">not_set_required_variables</span>.<span class="ruby-identifier">empty?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-variable_is_set-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">variable_is_set?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="variable_is_set-3F-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 186</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">variable_is_set?</span>
  <span class="ruby-identifier">variables</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">var</span><span class="ruby-operator">|</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">var</span>).<span class="ruby-identifier">nil?</span>}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-_set_default_values" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_set_default_values</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_set_default_values-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 231</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_set_default_values</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-current_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_element</span><span
                                class="method-args">(feed)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="current_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 216</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_element</span>(<span class="ruby-identifier">feed</span>)
  <span class="ruby-identifier">feed</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-initialize_variables" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">initialize_variables</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="initialize_variables-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 191</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize_variables</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">need_initialize_variables</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">variable_name</span>, <span class="ruby-identifier">init_value</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">init_value</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">init_value</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:call</span>)
        <span class="ruby-identifier">value</span> = <span class="ruby-identifier">init_value</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword">self</span>)
      <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">init_value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
        <span class="ruby-comment"># just for backward compatibility</span>
        <span class="ruby-identifier">value</span> = <span class="ruby-identifier">instance_eval</span>(<span class="ruby-identifier">init_value</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span>)
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">value</span> = <span class="ruby-identifier">init_value</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">&quot;@#{variable_name}&quot;</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-not_set_required_variables" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">not_set_required_variables</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="not_set_required_variables-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 265</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">not_set_required_variables</span>
  <span class="ruby-identifier">required_variable_names</span>.<span class="ruby-identifier">find_all</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">var</span>).<span class="ruby-identifier">nil?</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-required_variables_are_set-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">required_variables_are_set?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="required_variables_are_set-3F-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 271</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">required_variables_are_set?</span>
  <span class="ruby-identifier">required_variable_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">var</span>).<span class="ruby-identifier">nil?</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_default_values" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_default_values</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_default_values-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 220</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_default_values</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">yield</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@default_values_are_set</span>

  <span class="ruby-keyword">begin</span>
    <span class="ruby-ivar">@default_values_are_set</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-identifier">_set_default_values</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-keyword">ensure</span>
    <span class="ruby-ivar">@default_values_are_set</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_parent" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_parent</span><span
                                class="method-args">(target, parent)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_parent-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 252</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_parent</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">parent</span>)
  <span class="ruby-identifier">target</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-identifier">parent</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">need_parent?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-setup_other_elements" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">setup_other_elements</span><span
                                class="method-args">(feed, current=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="setup_other_elements-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 209</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">setup_other_elements</span>(<span class="ruby-identifier">feed</span>, <span class="ruby-identifier">current</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">current</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">current_element</span>(<span class="ruby-identifier">feed</span>)
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">other_elements</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">element</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">__send__</span>(<span class="ruby-node">&quot;setup_#{element}&quot;</span>, <span class="ruby-identifier">feed</span>, <span class="ruby-identifier">current</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-setup_values" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">setup_values</span><span
                                class="method-args">(target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="setup_values-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 235</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">setup_values</span>(<span class="ruby-identifier">target</span>)
  <span class="ruby-identifier">set</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">have_required_values?</span>
    <span class="ruby-identifier">variables</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">setter</span> = <span class="ruby-node">&quot;#{var}=&quot;</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">setter</span>)
        <span class="ruby-identifier">value</span> = <span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">var</span>)
        <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
          <span class="ruby-identifier">target</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">setter</span>, <span class="ruby-identifier">value</span>)
          <span class="ruby-identifier">set</span> = <span class="ruby-keyword">true</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">set</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-variables" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">variables</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="variables-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/maker/base.rb, line 256</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">variables</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">need_initialize_variables</span>.<span class="ruby-identifier">find_all</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">init</span><span class="ruby-operator">|</span>
    <span class="ruby-comment"># init == &quot;nil&quot; is just for backward compatibility</span>
    <span class="ruby-identifier">init</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">init</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;nil&quot;</span>
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">collect</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">init</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

